/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package listener;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import xmlutils.XMLAutoGenerator;

/**
 *
 * @author NoiR
 */
public class StartuptListener implements ServletContextListener{
    private ExecutorService exec;

    public void contextInitialized(ServletContextEvent sce) {
        exec = Executors.newSingleThreadExecutor();
        exec.submit(new XMLAutoGenerator());
    }

    public void contextDestroyed(ServletContextEvent sce) {
        exec.shutdown();
    }

}
